<?php

if (init()) {
  redirect("?action=login");
  exit();
}

?>
  <meta charset="UTF-8">

<?php


if (loginUser($_POST['login'], $_POST['pass'])) {
  redirect("?action=index");
} else {
  redirect($_SERVER['HTTP_REFERER']);
}